package com.accedo.achievements.services.ajax;

import net.sf.json.JSONObject;

public interface AppService {
	/**
	 * Get all applications in three state categories : finished, playing and none.
	 * <p>the sequence is grouped by the latest application to the front.
	 * <p>finished state means this user already unlocked all achievements of the application.<br>
	 * playing state means this user has unlocked part of achievements.<br>
	 * none state means this user has never unlocked any achievements related to the application.
	 * @param username	user name
	 * @return			JSON applications<br>
	 * eg. {appsns:[{appsn:'APP012',appname:'Chess Challenge III',state:'none'},
	 * {appsn:'APP011',appname:'Black Jack Pirates III',state:'finished'}]}
	 */
	public JSONObject getJsonAppsnsByUsername(String username);
	
	/**
	 * Get all applications in three state categories : finished, playing and none.
	 * <p>the sequence is grouped by finished application, playing application and then none application.
	 * <p>finished state means this user already unlocked all achievements of the application.<br>
	 * playing state means this user has partly unlocked the achievements.<br>
	 * none state means this user has never unlocked any achievements related to the application.
	 * @param username	user name
	 * @return			JSON applications<br>
	 * {appsns:[{appsn:'APP001',appname:'Hungry Harry I',state:'finished'},
	 * {appsn:'APP012',appname:'Chess Challenge III',state:'playing'},
	 * {appsn:'APP011',appname:'Black Jack Pirates III',state:'none'}]}
	 */
	public JSONObject getJsonAppsnsByUsernameForFriendShow(String username);
}
